#include "StrategyBank.h"
#include <string>
#include "Config.h"
#include "DefaultStrategy.h"
#include "ShotAheadStrategy.h"
#include "PlaneShotStrategy.h"
#include "ShotPlayerStrategy.h"
#include "BossLvl1Strategy.h"
#include "BeamShootStrategy.h"
#include "PlaneShot_1.h"
#include "PlaneShot_2.h"


StrategyBank::StrategyBank(void)
{
}


StrategyBank::~StrategyBank(void)
{
}

StrategyBank* StrategyBank::sharedStrategyBank()
{
	if (!_instance)
		_instance = new	StrategyBank();
	return _instance;
}

void StrategyBank::clearBank()
{
	delete _instance;
	_instance = NULL;
}

void StrategyBank::initBank()
{
}

BaseStrategy* StrategyBank::createStrategy(const  char* type )
{
	BaseStrategy* strategy = NULL;
	std::string strType = type;
	
	if (strType == STRATEGY_DEFAULT)
		strategy = DefaultStrategy::create();
	else if (strType == STRATEGY_SHOTAHEAD)
		strategy = ShotAheadStrategy::create();
	else if (strType == STRATEGY_PLANESHOT_1)
		strategy = PlaneShot_1::create();
	else if (strType == STRATEGY_PLANESHOT_2)
		strategy = PlaneShot_2::create();
	else if (strType == STRATEGY_SHOTPLAYER)
		strategy = ShotPlayerStrategy::create();
	else if (strType == STRATEGY_BOSSLVL1)
		strategy = BossLvl1Strategy::create();
	else if (strType == STRATEGY_BEAMSHOOT)
		strategy = BeamShootStrategy::create();
	else
		strategy = DefaultStrategy::create();
		
	return strategy;
}

StrategyBank* StrategyBank::_instance = NULL;
